﻿using DocumentFormat.OpenXml.Lite.Helper;
using DocumentFormat.OpenXml.Lite.SpreadsheetML.Excel.Types;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.SpreadsheetML.Excel.Table
{
    [XmlRoot("dataGroupItem", Namespace = Constants.ExcelMain)]
    public class DateGroupItem : XmlSerializable
    {
        [XmlAttribute("year", Form = XmlSchemaForm.Qualified)]
        public uint Year { get; set; }

        [XmlAttribute("dateTimeGrouping", Form = XmlSchemaForm.Qualified)]
        public ST_DateTimeGrouping DateTimeGrouping { get; set; }

        [Optional]
        [XmlAttribute("month", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> Month { get; set; }

        [Optional]
        [XmlAttribute("day", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> Day { get; set; }

        [Optional]
        [XmlAttribute("hour", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> Hour { get; set; }

        [Optional]
        [XmlAttribute("minute", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> Minute { get; set; }

        [Optional]
        [XmlAttribute("second", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> Second { get; set; }

        public DateGroupItem() { }
    }
}
